/*
 * @Description: 用户登录状态模块
 * @Author: feichong124
 * @Date: 2023-02-19 17:42:11
 * @LastEditors: feichong124
 * @LastEditTime: 2023-02-26 23:14:32
 */



import { defineStore } from 'pinia'

export const useCounterStore = defineStore('userStore', {
  state: () => ({
    user: "", // 登录的用户
    showLogin: false // 用于控制是否显示登录组件
  }),
  getters: {
    getUser (state) {
      return state.user
    },
    getShowLogin (state) {
      return state.showLogin
    }
  },
  actions: {
    setUser (data) {
      this.user = data;
    },
    setShowLogin (data) {
      this.showLogin = data;
    }
  },
});


